<form>
<div class="x-list-title">
<table width="100%" border="0" height="100%">
<tr><td align="left">
	<h2>Duyệt lịch cơ quan</h2>
</td><td align="right">	

<div class="x-list-options">	
	<div class="x-options-container">
		<a class="x-button"><span class="x-tri">&#9660;</span> Tác vụ khác</a>
		<div class="x-options">
			<a class="x-options-item x-track" url="<?php _baseUrl()?>/Calendar/Approve?act=approve">Duyệt lịch đã chọn</a>
			<a class="x-options-item x-track" url="<?php _baseUrl()?>/Calendar/Approve?act=unapprove">Bỏ duyệt lịch đã chọn</a>
		</div>
	</div>
</div>
</td></tr></table>	
</div>
<?php $vars = $this->get('vars');?>
<table width="100%" class="x-list" cellpadding="0" cellspacing="0">
<tr>
	<th width="25" align="center">
		TT
	</th>
	<th align="center" width="auto">
		<?php show_order_link('Tiêu đề','title','#Calendar/Company/Approve',$vars) ;?>
	</th>
	<th align="center" width="180">
		<?php show_order_link('Địa điểm','place','#Calendar/Company/Approve',$vars) ;?>
	</th>
	<th align="center" width="100">
		<?php show_order_link('Bắt đầu','date_start','#Calendar/Company/Approve',$vars) ;?>
	</th>
	<th align="center" width="100">
		<?php show_order_link('Người tạo','created_by_id','#Calendar/Company/Approve',$vars) ;?>
	</th>
	<th align="center" width="100">
		<?php show_order_link('Kiểu lặp','repeat_type','#Calendar/Company/Approve',$vars) ;?>
	</th>
	<th align="center" width="50" colspan="2">Tác vụ</th>
	<th align="center" width="25">
		<div class="x-check-container">
			<div class="x-check">
			<input type="checkbox" class="x-checkbox x-checkall"/>
			</div>
			<div class="x-check-options">
				<a class="x-check-item check-all">Chọn tất cả</a>
				<a class="x-check-item uncheck-all">Bỏ chọn tất cả</a>
				<a class="x-check-item check-unread">Chọn chưa duyệt</a>
				<a class="x-check-item check-read">Chọn đã duỵệt</a>
			</div>
		</div>
	</th>
</tr>
<?php if( count($this->get("posts")) > 0 ): ?>
<?php foreach( $this->get("posts") as $k => $a ): ?>
<tr class="<?php _e($a['is_approve']=='yes' ? 'x-read':'x-noread') ?>">
<td align="center">
	<?php _e($k+1);?>
</td>
<td>
	<a href="#Calendar/Company/View?ID=<?php _e($a['ID']);?>"><?php _e(short_title($a['title'],32));?></a>
</td>
<td align="center">
	<?php _e($a['place']);?>
</td>

<td align="center">
	<?php _e(show_date(DATE_FORMAT,$a['date_start']));?>
</td>

<td align="center">
	<a href="#User/Info?ID=<?php _e($a['created_by_id']);?>" class="userlink"><?php _e($a['created_by_name']);?></a>
</td>

<td width="120" align="center">
	<i>
	<?php if( $a['repeat_type'] == 'none'):?>
	Không lặp
	<?php elseif( $a['repeat_type'] == 'day'):?>
	Lặp ngày
	<?php elseif( $a['repeat_type'] == 'week'):?>
	Lặp tuần 
	<?php elseif( $a['repeat_type'] == 'month'):?>
	Lặp tháng
	<?php else:?>
	Lặp năm	
	<?php endif;?>
	</i>
</td>
<td align="center" width="25">
	<a onclick="module_delete('<?php _baseUrl()?>/Calendar/Company/Delete?ID=<?php _e($a['ID'])?>&redirect_url=<?php _e(rawurlencode('#Calendar/Company/Approve'));?>')" class="x-delete"></a>
</td>
<td align="center" width="25">
	<a href="#Calendar/Company/Edit?ID=<?php _e($a['ID'])?>" class="x-edit"></a>
</td>	
<td align="center">
	<input name="ID[]" value="<?php _e($a['ID'])?>" type="checkbox" class="x-checkbox x-checkall"/>
</td>
</tr>
<?php endforeach;?>
<tr>
	<td colspan="9" class="page">
	<div class="x-page">
		<?php $this->e("page");?>
	</div>		
	</td>
</tr>
<?php else:?>
<tr>
	<td colspan="9" class="page"><div class="x-page">
			Không có lịch nào cần duyệt
		</div>
	</td>
</tr>
<?php endif;?>
</table>
</form>